<?php

namespace app\v1\controller;

use think\Controller;
use think\Request;
use think\Validate;

/**
 * Class Comment
 * @package app\v1\controller
 * 每日点评模块的控制器
 */
class Comment extends Authorization
{
    /**
     * 每日点评
     *
     * @return \think\Response
     */
    public function everydayCommentList()
    {
        $comment=model('v1/Comment');
        $comment->everydayCommentList();
    }

    //点赞或取消点赞
    public function setCommentPoint(){
        $commentId=input('commentId',0,'int');
        $type=input('type',0,'int');
        $validate=new Validate([
            'commentId'=>'require',
            'type'=>'require'
        ]);
        $validate->message([
            'commentId.require'=>'commentId参数值不能为空',
            'type.require'=>'type不能为空'

        ]);
        $data=$this->request->post();
        if(!$validate->check($data)){
            renderInfo(400001,$validate->getError());
        }
        $comment=model('v1/Comment');
        $comment->setCommentPoint($commentId,$type);
    }


}
